package com.success.task.web.lucene.interfaces;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.store.LockObtainFailedException;

/**
 * @author shimei
 * @version 2012-2-16 IndexCreateInterface.java
 * 索引创建接口 适用于 固定目录的文件
 */
public interface IndexCreateInterface extends IndexInterface {
	
	  /**
     *  初始化
     *  indexWriter 
     *  初始化分析器
     *  analyzer
     *  初始化索引目录
     *  indexDir
     *  初始化索引目标目录
     *  dataDir
     *  为创建索引做好前期准备
     * @throws CorruptIndexException
     * @throws LockObtainFailedException
     * @throws IOException
     * @throws InstantiationException
     * @throws IllegalAccessException
     * @throws ClassNotFoundException
     */
	public void init() throws CorruptIndexException, LockObtainFailedException, 
						IOException ,InstantiationException ,IllegalAccessException ,ClassNotFoundException ;
	/**
	 * 创建索引
	 * @throws CorruptIndexException
	 * @throws LockObtainFailedException
	 * @throws IOException
	 */
	public void createIndex() throws CorruptIndexException, LockObtainFailedException,IOException ;
	
	/**
	 * @throws FileNotFoundException
	 * @throws IOException
	 */
	public void index(IndexWriter indexWriter,File root) throws FileNotFoundException,IOException ;
}
